package com.hdd.biz.finance.controller;


import com.hdd.biz.finance.dto.WithdrawCreateRequest;
import com.hdd.biz.finance.dto.WithdrawListRequest;
import com.hdd.biz.finance.dto.WithdrawRecordRequest;
import com.hdd.biz.finance.dto.WithdrawVerifyRequest;
import com.hdd.biz.finance.service.WithdrawService;
import com.hdd.biz.finance.service.impl.WithdrawServiceImpl;
import com.hdd.dto.SuperResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * <p>
 * 提现处理 前端控制器
 * </p>
 *
 * @author fang
 * @since 2021-02-23
 */
@RestController
@RequestMapping("/finance/withdraw")
@Api(value = "提现模块",tags = {"提现模块"})
@CrossOrigin(origins = "*",maxAge = 3600)
public class WithdrawController {


    @Autowired
    private WithdrawServiceImpl withdrawService;


    @PostMapping("/record")
    @ApiOperation(value = "提现记录(会员)" ,notes = "")
    public SuperResponse verifyWithdraw(@Valid @RequestBody WithdrawRecordRequest request ){
        return withdrawService.withdrawRecord(request);
    }

    @PostMapping("/create")
    @ApiOperation(value = "提现(会员)" ,notes = "")
    public SuperResponse createWithdraw(@Valid @RequestBody WithdrawCreateRequest request ){
        return withdrawService.createWithdraw(request);
    }

    @PostMapping("/list")
    @ApiOperation(value = "提现列表" ,notes = "")
    public SuperResponse withdrawList(@Valid @RequestBody WithdrawListRequest request ){
        return withdrawService.withdrawList(request);
    }

    @PostMapping("/verify")
    @ApiOperation(value = "提现审核" ,notes = "")
    public SuperResponse verifyWithdraw(@Valid @RequestBody WithdrawVerifyRequest request ){
        return withdrawService.verifyWithdraw(request);
    }


    @PostMapping("/weiXinVerify")
    @ApiOperation(value = "提现审核（微信）" ,notes = "")
    public SuperResponse weiXinVerify(@Valid @RequestBody WithdrawVerifyRequest request ){
        return withdrawService.weiXinVerify(request);
    }
}

